package org.gruposp2p.proyectokarma.gwt.client.cometd.ui;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.Widget;

public class ChannelsDialog extends Composite {

    private static ChannelsDialogUiBinder uiBinder =
    	GWT.create(ChannelsDialogUiBinder.class);

    interface ChannelsDialogUiBinder extends UiBinder<Widget, ChannelsDialog> { }

    @UiField DialogBox dialogBox;
    @UiField Button closeButton;

    public ChannelsDialog() {
        uiBinder.createAndBindUi(this);
    }


    public void show(int left, int top) {
        dialogBox.setPopupPosition(left, top);
        dialogBox.show();
    }

    @UiHandler("closeButton")
    void onClick(ClickEvent e) {
        dialogBox.hide();
    }

}
